package com.zretc.support.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.models.auth.In;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;

/**
 * @Description  
 * @Author  jiaminxxi
 * @Date 2020-07-28 11:47:44 
 */

@Entity
@Table ( name ="score" , schema = "")
public class Score  implements Serializable {

	private static final long serialVersionUID =  5044387021307572376L;

	/**
	 * 成绩编号
	 */
	@Id
   	@Column(name = "scoreId" )
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer scoreId;

	/**
	 * 考试编号
	 */
	@ManyToOne
	@JoinColumn(name = "examId")
	private Exam exam;
	/**
	 * 学生编号
	 */

	@ManyToOne
	@JoinColumn(name = "userId")
	private User student;

	/**
	 * 总成绩
	 */
   	@Column(name = "totalScore" )
	private double totalScore;

	/**
	 * 参考时间
	 */
   	@Column(name = "joinTime" )
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private Date joinTime;

	/**
	 * 交卷时间
	 */
   	@Column(name = "submitTime" )
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private Date submitTime;

	public Score() {
	}

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}

	public Integer getScoreId() {
		return scoreId;
	}

	public void setScoreId(Integer scoreId) {
		this.scoreId = scoreId;
	}

	public Exam getExam() {
		return exam;
	}

	public void setExam(Exam exam) {
		this.exam = exam;
	}

	public User getStudent() {
		return student;
	}

	public void setStudent(User student) {
		this.student = student;
	}

	public double getTotalScore() {
		return totalScore;
	}

	public void setTotalScore(double totalScore) {
		this.totalScore = totalScore;
	}

	public Date getJoinTime() {
		return joinTime;
	}

	public void setJoinTime(Date joinTime) {
		this.joinTime = joinTime;
	}

	public Date getSubmitTime() {
		return submitTime;
	}

	public void setSubmitTime(Date submitTime) {
		this.submitTime = submitTime;
	}

	@Override
	public String toString() {
		return "Score{" +
				"scoreId=" + scoreId +
				", exam=" + exam +
				", student=" + student +
				", totalScore=" + totalScore +
				", joinTime=" + joinTime +
				", submitTime=" + submitTime +
				'}';
	}
}
